<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>监视属性-天气</title>
    <script type="text/javascript" src="../../../public/vue.js"></script>
</head>
<body>
<div id="root">
    <h2>今天天气很{{info}}</h2>
    <button @click="changeWeather">切换天气</button>
</div>
</body>
<script type="text/javascript">
    new Vue({
        el:'#root',
        data:{
            isHost:true
        },
        computed:{
            info:function (){
                return this.isHost?'炎热':'凉爽'
            }
        },
        methods:{
            changeWeather(){
                this.isHost =!this.isHost
            }
        }
    })
</script>
</html>